package com.ticket.service.impl;

import com.ticket.dao.ScheduleDao;
import com.ticket.dao.impl.ScheduleDaoImpl;
import com.ticket.entity.VSchedule;
import com.ticket.service.ScheduleService;
import com.ticket.util.MybatisUtil;
import com.ticket.util.Page;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author 王玲娟
 * @version 8.0
 * @description TODO    影院电影安排服务层实现类
 * @date 2023-10-08
 */
public class ScheduleServiceImpl implements ScheduleService {

   static ScheduleDao sd;
   static {
     SqlSession sqlSession =  MybatisUtil.getSqlSession();
     sd =  sqlSession.getMapper(ScheduleDao.class);
   }
    /**
    * @author WangLingJuan
    * @description TODO 影院影厅安排查询
    * @date 2023-10-08 9:14
     * @param schedule  参数 movie_cn_name,hall_name
     * @param page
    * @return org.t69.auction.Page<com.ticket.entity.Schedule>
    */

    @Override
    public Page<VSchedule> selSchedule(VSchedule schedule, Page<VSchedule> page) {

        List<VSchedule> scheduleList = sd.selSchedule(schedule,page);//查询数据集合
        int count = sd.selCount(schedule,page);//查询总记录数
        page.setDataList(scheduleList);
        page.setTotalCount(count);
        return page;
    }
}
